﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using TCKQKL.FrontEnd.DataModel;

namespace TCKQKL.FrontEnd.Web.Controls
{
    public partial class OrderConfirm : System.Web.UI.UserControl
    {
        public OrdersOnlineUI Submited
        {
            set
            {
                if (value != null)
                {
                    if (!string.IsNullOrEmpty(value.OrderSide))
                        if (value.OrderSide.Equals("BUY"))
                            lblOrderSide.Text = "MUA";
                        else
                            if (value.OrderSide.Equals("SELL"))
                                lblOrderSide.Text = "BÁN";
                    if (!string.IsNullOrEmpty(value.OrderType))
                        if (value.OrderType.Equals("PLACE"))
                            lblOrderType.Text = "ĐẶT";
                        else
                            if (value.OrderType.Equals("CHANGE"))
                                lblOrderType.Text = "SỬA";
                            else
                                if (value.OrderType.Equals("CANCEL"))
                                    lblOrderType.Text = "HUỶ";
                    if (!string.IsNullOrEmpty(value.Symbol))
                        lblSymbol.Text = value.Symbol.ToUpper();
                    if (value.Quantity > 0)
                        lblQuantity.Text = value.Quantity.ToString();
                    if (value.OrderClass.Equals("LO"))
                    {
                        if (!string.IsNullOrEmpty(value.Price))
                            lblPrice.Text = value.Price;
                    }
                    else
                        lblPrice.Text = value.OrderClass;
                    lblExpireDate.Text = value.ExpireDate.ToString("dd/MM/yyyy");
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {

        }
    }
}